home *** CD-ROM | disk | FTP | other *** search
- program savage; { 9/9/89, ljr }
-
- uses tphrt;
-
- const
- iloop = 2500;
- var
- hits, elapsed, i : longint;
- a : real;
-
- function tan (a:real) : real;
-
- begin
- tan := sin (a) / cos (a);
- end;
-
- begin
- a := 1.0;
- t_start; { init the timer }
- writeln;
- writeln ('SAVAGE BENCHMARK, (tp55 with high resolution timers).');
- writeln;
- write ('start...');
- t_entry(1); { start the timer }
- for i := 1 to iloop do begin
- a := tan(arctan(exp(ln(sqrt(a * a))))) + 1;
- end;
- t_exit(1); { stop the timer }
- t_stop; { un-init the timer }
- t_ask_timer(1,hits,elapsed);
- writeln ('stop');
- writeln;
- writeln ('Elapsed time for 2500 iterations was ',
- (elapsed/1000000.0):10:6,' seconds,');
- writeln ('and the resolution for ''A'' was ',(a/(iloop+1)) : 15:14);
- end.
-